﻿using RayDen.RayEngine.Core.Interface;
using RayDen.RayEngine.Data;

namespace RayDen.RayEngine.Scene
{
    public class LightObject : ScenePrimitive<ILight, EmissionProfile>
    {
        public LightObject(ILight prim, EmissionProfile mat)
            : base(prim, mat)
        {
            if (prim is MeshLight)
            {
                var m = (prim as MeshLight).mesh;
                for (var i = (uint) m.StartTriangle; i < m.EndTriangle; i++)
                {
                    indexes.Add(i);
                }
            }
        }

        public override ScenePrimitiveType PrimitiveType
        {
            get { return ScenePrimitiveType.Light; }
        }
    }
}